package com.kfm.am;

import java.util.Random;

public class Test01 {

    public static void main(String[] args) {
        System.out.println(new Random().nextInt(39) + 1);
    }

    // 按照年龄降序,姓名升序
    public static void insertSort(Student[] students) {
        for (int i = 1; i < students.length; i++) {
            Student stu = students[i];
            int prevIndex = i - 1;
            // getAge
            while (prevIndex >= 0 && stu.getAge() < students[prevIndex].getAge()) {
                students[prevIndex + 1] = students[prevIndex];
                prevIndex --;
            }
            students[prevIndex + 1] = stu;
        }
    }
}
